#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QtGui>
#include "rawimage.h"
#include "imageprocessor.h"
#include "histwidget.h"
#define MATRIX_WIDTH 254
#define MATRIX_HEIGHT 255
#define MATRIX_SIZE 256
namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT
    
public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
    void MainWindow::TableToMatrix();
    bool isBin;
private slots:
    void on_actionOpen_triggered();

    void on_horizontalSlider_valueChanged(int value);

    void on_actionShow_Option_View_toggled(bool arg1);

    void on_actionGray_Hist_View_toggled(bool arg1);

    void on_pushButton_7_clicked();

    void on_pushButton_clicked(bool checked);

    void on_pushButton_3_clicked();

    void on_pushButton_4_clicked();

    void on_pushButton_2_clicked();

    void on_pushButton_5_clicked();

    void on_comboBox_currentIndexChanged(int index);

    void on_pushButton_6_clicked();

    void on_raw_image_label_wheelSignal(QWheelEvent *);

    void label_mouse_move(QMouseEvent *ev);

    void on_pushButton_10_clicked();

    void on_comboBox_2_currentIndexChanged(int index);

    void on_zoom_silder_valueChanged(int value);

    void on_pushButton_8_clicked();

    void on_pushButton_3_clicked(bool checked);

    void label_leave()
    {
        this->statusBar()->showMessage(QString("").sprintf("Color:R[     ] G[     ] B[     ]"));
    }


    void on_pushButton_9_clicked();

    void on_pushButton_11_clicked();

    void on_pushButton_12_clicked();

    void on_pushButton_13_clicked();

    void on_pushButton_14_clicked();

    void on_pushButton_15_clicked();

    void on_pushButton_16_clicked();

    void on_pushButton_18_clicked();

    void on_pushButton_17_clicked();

    void on_pushButton_21_clicked();

    void on_pushButton_22_clicked();

    void on_pushButton_19_clicked();

    void on_pushButton_20_clicked();

    void on_pushButton_24_clicked();

    void on_spinBox_valueChanged(int arg1);

    void on_spinBox_2_editingFinished();

    void on_spinBox_2_valueChanged(int arg1);


    void on_pushButton_23_clicked();

    void on_comboBox_3_currentIndexChanged(int index);

private:

    float hist[256];

    void SetImage(QImage image);

    void SetSecondImage(QImage image);

    void zoomImage();

    BinaryOperation bin_operation;

    short zoom_mode;

    QImage raw_image;

    QImage second_image;

    QSize raw_size;

    HistogramPainter *hist_widget;

    Ui::MainWindow *ui;

    float matrix[MATRIX_SIZE];
};

#endif // MAINWINDOW_H
